#!/usr/bin/perl 

$site = shift;

if (!defined($site))
{
    exit("请提供site的名称\n");
}

$site_up = ucfirst $site;

$className = $site_up . 'Analyzer';

$content = <<EOF;

<?php
//    require_once('class.BasicAnalyzer.php');
    /**
    * 用于提取 $site 网站的视频
    *
    */
    class $className extends BasicAnalyzer implements Analyzer
    {
        public \$features = array("url" => "//i");

        public function analyze(\$content, \$url)
        {
            //===================================
            \$rv = array(
                array(
                    "url" => \$vurl, 
                    "title" => \$title,
                    "descr" => \$descr,
                    "referer" => \$referer,
                    "tags" => \$tags, 
                    "category" => \$category,
                    "ext" => \$ext,
                    "pub_date" => \$pub_date,
                    "author" => \$author
                    )
                );

            
            //===================================

            return \$rv;
        }
    }

?>
EOF

open FILE, ">./class.$className.php";
print FILE $content;
close FILE;
